import domain from './domain'

const LOGIN_DOMAIN = domain.LOGIN_DOMAIN
const HOMEWORK_DOMAIN = domain.HOMEWORK_API_DOMAIN

export default {
  SENDCODE: LOGIN_DOMAIN + '/v1/auth/sendPhoneCode',
  LOGIN: LOGIN_DOMAIN + '/v1/auth/login',
  DISTRICTS: 'v1/teaching/uc/schadm/districts',
  DISTRICTS2: 'v1/teaching/web/districts',
  DISTRICTSCHOOLS: 'v1/teaching/uc/schadm/district/schools',
  SCHOOLS: 'v1/teaching/uc/schadm/schools',
  SCHOOL: 'v1/teaching/uc/schadm/school',
  SCHOOLSBYIDS: 'v1/learning/web/schools',
  SCHOOLSBYADMIN: 'v1/teaching/web/getSchoolsForSchoolAdmin2',
  
  OPTIONS: 'v1/teaching/web/options',

  TEACHERS: 'v1/teaching/web/teachers',
  TEACHER: 'v1/teaching/web/teacher',
  CLEARTEACHER: 'v1/teaching/uc/schadm/schools/user/teacher',
  ACCOUNT: 'v1/teaching/web/teacher/account',

  STUDENTS: 'v1/teaching/web/students',
  STUDENT: 'v1/teaching/web/student',
  CLEARSTUDENT: 'v1/teaching/uc/schadm/schools/user/student',
  EXPORT_STUDENT: '/v1/teaching/uc/schadm/schools/export/user/student/account',

  CLASSES: 'v1/teaching/web/classes',
  TEACH_INFO: 'v1/teaching/web/classes2',   // 班级列表的任教信息
  CLASS_TEACH_INFO: 'v1/teaching/web/class/teacher',   // 更新班级某科目的任教信息
  CLASS: 'v1/teaching/web/class',
  ALL_CLASSES: 'v1/teaching/web/school/grade/classes',

  TERM: 'v1/teaching/web/term',

  // 权限管理相关的接口 url
  USERINFO: 'v1/learning/web/user/info',
  USERS: 'v1/learning/web/child/user',
  // SYS_USERS: 'v1/learning/web/child/sys_user',
  SYS_USERS: 'v1/learning/web/child/sys_user_new',
  USER: 'v1/learning/web/create/user', // 更新/创建成员（旧接口，已废弃）
  USER_CREATE_UPDATE: 'v1/teaching/uc/user', // 创建或更新用户（新接口，使用rb_user和rb_user_role表）
  // DELETEUSER: 'v1/learning/web/delete/user',
  DELETEUSER_NEW: 'v1/learning/web/delete/user_new', // 删除用户（新方法：软删除用户，真删除关联表和rb_phone_super_code）
  DISABLEUSER: 'v1/learning/web/user/disable', //禁用已创建的用户
  
  // 系统成员管理相关接口
  SYSTEM_USERS: 'v1/learning/web/system/users',
  SYSTEM_USER: 'v1/learning/web/create/system/user', // 更新/创建系统成员
  DELETE_SYSTEM_USER: 'v1/learning/web/delete/system/user',
  DISABLE_SYSTEM_USER: 'v1/learning/web/system/user/disable', // 禁用系统成员
  
  ROLES: 'v1/learning/web/manager/roles',
  // 已废弃：改用 SYSTEM_ROLE_LIST、SYSTEM_ROLE_NON_SCHOOL 等新接口
  // SYSROLES: 'v1/learning/web/manager/sys_roles',
  SYSTEM_ROLE_LIST: 'v1/teaching/uc/system-role/list', // 获取系统角色列表（rb_system_role）
  SYSTEM_ROLE_PAGE: 'v1/teaching/uc/system-role/page', // 分页获取系统角色列表（支持权限过滤）
  SYSTEM_ROLE_NON_SCHOOL: 'v1/teaching/uc/system-role/non-school', // 获取所有非学校角色列表（F_is_school_role=0）
  SYSTEM_ROLE_SCHOOL: 'v1/teaching/uc/system-role/school', // 获取所有学校角色列表（F_is_school_role=1）
  SYSTEM_ROLE_CREATE: 'v1/teaching/uc/system-role', // 创建系统角色（POST）
  SYSTEM_ROLE_UPDATE: 'v1/teaching/uc/system-role', // 更新系统角色（PUT）
  SYSTEM_ROLE_DELETE: 'v1/teaching/uc/system-role', // 删除系统角色（DELETE）
  ROLE: 'v1/learning/web/create/role', // 更新/创建角色
  DELETEROLE: 'v1/learning/web/manager/delete/role', // 删除角色
  DISABLEROLE: 'v1/learning/web/manager/role/disable', //禁用已创建的角色

  // 导入、导出相关 api 的 url
  // 导出整班学生信息
  EXPORTSTUDENTID: HOMEWORK_DOMAIN + '/v1/homeworks/studentinfo/export',
  EXPORT: 'v1/teaching/uc/schadm/schools/export/user',
  EXPORTSTUDENT: 'v1/teaching/uc/schadm/schools/export/user/student',
  EXPORTTEACHER: 'v1/teaching/uc/schadm/schools/export/user/teacher',
  PREVIEWSCHOOL: '/v1/teaching/uc/schadm/schools/import/preview/user3',
  PREVIEWSTUDENT: '/v1/teaching/uc/schadm/schools/import/preview/user/student/new',
  PREVIEWTEACHER: '/v1/teaching/uc/schadm/schools/import/preview/user/teacher/new',
  CONFIRMSCHOOL: '/v1/teaching/uc/schadm/schools/import/user',
  CONFIRMSTUDENT: '/v1/teaching/uc/schadm/schools/import/user/student',
  CONFIRMTEACHER: '/v1/teaching/uc/schadm/schools/import/user/teacher',
  PREVIEW_USER: '/v1/teaching/uc/schadm/schools/import/preview/user/role/new',
  CONFIRM_USER: '/v1/teaching/uc/schadm/schools/import/user/role',
  PREVIEW_UPDATE_STUDENT: '/v1/teaching/uc/schadm/schools/import/preview/user/student2/new',
  CONFIRM_UPDATE_STUDENT: '/v1/teaching/uc/schadm/schools/import/user/student2',
  EXPORT_TEACHER_AND_STUDENTS: 'v1/teaching/uc/schadm/export/teacher_and_students',

  // 批量更新学生密码
  EDIT_STUDENT_PW: 'v1/teaching/web/student/class/pwd',
  // 批量更新老师密码
  EDIT_TEACHER_PW: 'v1/teaching/web/teacher/password',

  // 批量更新管理员密码
  UPDATE_USER_PW: 'v1/teaching/web/manager/password',

  SCHOOL_SUBJECT_LIST: domain.EXAM_API_DOMAIN + '/v1/subject/get',
  EDIT_USER_PWD: '/v1/learning/web/userPassword',
  GENERATE_ACCOUNT: '/v1/teaching/web/manager/account',

  USER_TEACH_INFO: '/v1/teaching/web/user/isTeacher',
  GET_USER: '/v1/learning/web/child/getUserByPhone',

  // 合并学生
  COMBINE_STUDENTS: '/v1/teaching/web/student/merge',

  UPLOAD_EXCEL: '/v1/teaching/uc/schadm/schools/import/user/page',
  USER_DISTRICT_LIST: '/v1/teaching/districts',
  USER_SCHOOL_LIST: '/v1/teaching/getSchoolsForSchoolAdmin2',
  SCHOOL_MASTER: '/v1/learning/web/special/user',
  SCHOOL_MASTER2: '/v1/learning/web/special/user2',
  SCHOOL_USER_LIST: '/v1/learning/web/school/leader',
  UPDATE_ROLE_USER: '/v1/learning/web/batch/user',
  CREATE_SCHOOL: 'v1/teaching/joint/autoMultiCreate',
  UPDATE_SCHOOL_NAME: 'updateSchoolName',

  CHECKSCHOOLDATAINIT: HOMEWORK_DOMAIN + '/api/school/checkInitStatus',
  
  // 高中升学相关接口
  GRADE_UPGRADE: 'v1/teaching/web/school/grade/upgrade',
  
  // 菜单管理相关接口
  MENU_LIST: 'v1/teaching/uc/menu/list', // 获取用户菜单列表
  MENU_TOP_BY_USER: 'v1/teaching/uc/menu/top/by-user', // 根据用户ID获取顶级菜单（parent_id=0）
  MENU_ALL: 'v1/teaching/uc/menu/all', // 获取所有菜单列表（管理用）
  MENU_ALL_BY_USER: 'v1/teaching/uc/menu/all/by-user', // 根据用户ID获取所有菜单权限（包括所有按钮权限）
  MENU: 'v1/teaching/uc/menu', // 创建/更新/删除菜单
  MENU_BY_ROLE: 'v1/teaching/uc/menu/role', // 根据角色获取菜单/设置角色菜单
  MENU_ROLE_IDS: 'v1/teaching/uc/menu/role/ids', // 获取角色已分配的菜单ID列表
  MENU_SYSTEM_ROLE_IDS: 'v1/teaching/uc/menu/system/role/ids', // 获取系统角色（rb_system_role）已分配的菜单ID列表
  MENU_SYSTEM_ROLE: 'v1/teaching/uc/menu/system/role', // 设置系统角色（rb_system_role）菜单权限
  MENU_CHILDREN: 'v1/teaching/uc/menu/children', // 根据菜单ID获取子菜单和功能按钮
  
  // 用户权限相关接口
  GET_USER_PERMISSION2: 'v1/teaching/joint/getUserPermission2', // 获取用户权限信息
}
